package com.example.auth.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * sys-department
 *
 * @author cuihaida
 */
@Data
public class SysDepartment {

    /**
     * dept id
     */
    private Long id;

    /**
     * dept name
     */
    private String name;

    /**
     * dept manager
     */
    private String manager;

    /**
     * dept phone
     */
    private String phone;

    /**
     * dept email
     */
    private String email;

    /**
     * dept parent id
     */
    private Long parentId;

    /**
     * dept order num
     */
    private Integer orderNum;

    /**
     * dept create time
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    /**
     * dept children
     */
    private List<SysDepartment> children = new ArrayList<>();
}
